//
//  FunctionViewController.m
//  WordTutor
//
//  Created by lyh on 15/11/19.
//  Copyright © 2015年 lyh. All rights reserved.
//

#import "FunctionViewController.h"
#import "FunctionBtnView.h"

@interface FunctionViewController ()

@end

@implementation FunctionViewController

-(void)loadView {
    self.view = [[UIView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self layoutSubView];
    
   FunctionBtnView *funBtnView = [FunctionBtnView functionBtnView:CGRectMake(0, (self.view.height - self.view.width) / 2.f, self.view.width, self.view.width)];
    [self.view addSubview:funBtnView];
}

-(void) layoutSubView {
    CGRect frame = [UIScreen mainScreen].bounds;
    
    UIButton *backBtn = [[UIButton alloc]initWithFrame:CGRectMake(frame.size.width - 50 - 20 , 20, 60, 35)];
    backBtn.backgroundColor = [UIColor redColor];
    
    [backBtn addTarget:self action:@selector(didClickByBack:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backBtn];

}

-(void) didClickByBack: (UIButton *)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)dealloc {
    NSLog(@"[200] ---%s ---%d", __func__, __LINE__);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
